%%%-------------------------------------------------------------------
%%% @author Rain
%%% @copyright (C) 2022, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 01. 4月 2022 20:03
%%%-------------------------------------------------------------------
-module(bag_test).
-author("Rain").
-include("bag.hrl").

%% API
-export([test/0]).

test() ->
    Bag = #bag{},
    Player = #{bag => Bag},
    Player1 = bag:add_items([{1001, 10}, {1001, 20}, {1002, 100}, {1003, 20}, {1003, 40}, {1003, 40, 1}], ?BAG_TYPE_NORMAL_BAG, Player),
    Player2 = bag:del_items([{1001, 30}], ?BAG_TYPE_NORMAL_BAG, Player1),
    Player3 = bag:add_items([{1001, 5}], ?BAG_TYPE_NORMAL_BAG, Player2),
    Player4 = bag:sort_bag(?BAG_TYPE_NORMAL_BAG, Player3),
    io:format("Player = ~p~n",[Player4]).
